﻿<%@ Page Language="C#" %>
<%@ Import Namespace="System.IO" %>
<%
    int id=Int16.Parse(Request["id"]);
    DTO.SanPhamDto sp = BUS.SanPhamBus.LaySanPhamTheoID(id);
    if (sp != null)
    {
        sp.Hinh = ResolveClientUrl("~/" + sp.Hinh);       
        String link = sp.Hinh.Replace("/", "\\");
        try
        {
            FileInfo file = new FileInfo(MapPath(".")+"\\" + link);
            if (file.Exists)
                file.Delete();
            Response.Write(BUS.SanPhamBus.xoaSanPham(id).ToString());
        }
        catch (FileNotFoundException ex)
        {
            
        }
        
    }
%>